<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.1.0/echarts.common.js"></script>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        div{
            width: 600px;
            height: 500px;
            border: 1px solid black;
        }
    </style>
    
</head>
<body>
      <div></div>
      <script>
        let dom = document.querySelector('div');
        let myChart = echarts.init(dom)
        // console.log(myChart);
       myChart.setOption({
            title:{
                text:'数据可视化',
               left:'center',
                textStyle:{
                    color:'red',
                    fontSize:14,
                  
                },
                subtext:'echart基本使用'
            },
            xAxis:{
        
                 data:['星期一','星期二','星期三','星期四','星期五','星期六','星期天']
            },
            yAxis:{
                 //显示Y轴的线
               axisLine:{
                   show:true
               },
               //显示Y轴刻度
               axisTick:{
                   show:true
               }
            },
            series:[
                {
                    type:'bar',
                    data:[10,20,30,40,50,60,70],
                    color:'pink'
                },
                {
                    type:'line',
                    data:[10,20,30,40,50,60,70],
                    color:'red'
                },
                {
      name: 'Access From',
      type: 'pie',
      radius: '55%',
      center: ['50%', '50%'],
      data: [
        { value: 335, name: 'Direct' },
        { value: 310, name: 'Email' },
        { value: 274, name: 'Union Ads' },
        { value: 235, name: 'Video Ads' },
        { value: 400, name: 'Search Engine' }
      ].sort(function (a, b) {
        return a.value - b.value;
      }),
      roseType: 'radius',
      label: {
        color: 'rgba(255, 255, 255, 0.3)'
      },
      labelLine: {
        lineStyle: {
          color: 'rgba(255, 255, 255, 0.3)'
        },
        smooth: 0.2,
        length: 10,
        length2: 20
      },
      itemStyle: {
        color: '#c23531',
        shadowBlur: 200,
        shadowColor: 'rgba(0, 0, 0, 0.5)'
      },
      animationType: 'scale',
      animationEasing: 'elasticOut',
      animationDelay: function (idx) {
        return Math.random() * 200;
      }
    }
            ]
       })
     </script>
</body>
</html>
